<include file="Public/HOME/HTML/head_html_5.html" />
<title>注册账户{$Think.const.TITLE}</title>
<include file="Public/HOME/HTML/CssAndJs.html" />
<include file="Public/HOME/HTML/middle_list.html" />
<script type="text/javascript"
	src="http://code.hs-cn.com/jquery/jquery-1.7.1.min.js">
	
</script>
<meta charset=utf-8 />
<style type="css/html">
	.rad{
		color: black;
	}
</style>
<script language="JavaScript">
	function changeVerify() {
		var timenow = new Date().getTime();
		document.getElementById('verifyImg').src = '{$Think.const.DOMAIN_NAME}Operation/Hint/Verify/'
				+ timenow;
	}
</script>
<script language="javascript">
	function checkLen() {
		var username = document.getElementById("username").value.length;
		var password = document.getElementById("password").value.length;
		var password_ok = document.getElementById("password_ok").value.length;

		var phone = document.getElementById("phone").value;

		var username_value = document.getElementById("username").value;
		var password_1 = document.getElementById("password").value;
		var password_2 = document.getElementById("password_ok").value;

		if (password_1 != password_2) {
			alert("两次密码输入不一样!");
			return false;
		}

		if (username < 3) {
			alert("用户名长度不能小于3哦!");
			return false;
		}

		if (password < 5 || password_ok < 6) {
			alert("密码长度不能小于6哦!");
			return false;
		}

		if (phone < 11) {
			alert("电话号的长度不对哦!");
			return false;
		}

		return true;
	}
</script>
<script language="javascript">
	$(document).ready(function() {
		checkConfirm();
	});

	// 验证用户名是否存在输入是否合法
	function checkConfirm() {
		$("#username")
				.blur(
						function() {

							var timenow = new Date().getTime();
							var username = $("#username").val();
							var checkUsernameUrl = "{$Think.const.DOMAIN_NAME}/Home/Account/checkName/id/"
									+ username + "/" + timenow;

							if (username.length < 3 || username.length == 0) {
								// 长度不能小于3
								document.getElementById('usernameState').className = 'has-error';
								$("#usernameInfo").text("用户名长度不能小于3");
								return false;
							}

							$
									.get(
											checkUsernameUrl,
											function(returnInfo) {

												if (returnInfo != 0) {
													// 已经被使用
													document
															.getElementById('usernameState').className = 'has-error';
													$("#usernameInfo").text(
															"用户已存在");
													return false;

												} else {
													document
															.getElementById('usernameState').className = 'has-success';
													$("#usernameInfo")
															.html(
																	'<i class="icon-check"></i>');
													return false;
												}

											});

							return false;
						})

		// 判断密码位数是否一致
		$("#password")
				.blur(
						function() {

							var password = $("#password").val();
							if (password.length == 0 || password.length < 6) {
								document.getElementById('passwordState').className = 'has-error';
								$("#passwordInfo").text("密码不能少于6位");
								return false;
							} else {
								document.getElementById('passwordState').className = 'has-success';
								$("#passwordInfo").html(
										'<i class="icon-check"></i>');
								return true;
							}
						});

		// 判断两次密码输入是否一致
		$('#password_ok')
				.blur(
						function() {

							var password = $("#password").val();
							var password_ok = $('#password_ok').val();

							if (password != password_ok) {
								document.getElementById('password_okState').className = 'has-error';
								$("#password_okInfo").text("两次输入密码不一致");
								return false;
							} else {
								document.getElementById('password_okState').className = 'has-success';
								$("#password_okInfo").html(
										'<i class="icon-check"></i>');
							}
						})
	}
</script>
<!-- End Navigation -->
<div class="container-fluid main-content">
	<div class="row">
		<div class="col-lg-12">
			<div class="widget-container fluid-height clearfix">
				<div class="heading">
					<i class="icon-reorder"></i>注册
				</div>
				<div class="widget-content padded">
					<form method="post" action="__SELF__" class="form-horizontal"
						onsubmit="return checkLen()" enctype="multipart/form-data">
						
						<div class="form-group" style="margin: 0 0 20px 100px">
							<label class="control-label col-md-2"> <strong>用户名</strong>
							</label>
							<div id="usernameState">
								<div class="col-md-7 ">
									<input class="form-control " value="" maxLength="20"
										id="username" placeholder="请输入字母、数字或符号的组合" type="text"
										name="username" required>
								</div>
								<div class="col-md-3 " id="usernameInfo"></div>
							</div>
						</div>
						
						<div class="form-group" style="margin: 0 0 20px 100px">
							<label class="control-label col-md-2"> <strong>密&nbsp;码</strong>
							</label>
							<div id="passwordState">
								<div class="col-md-7">
									<input class="form-control" value="" maxLength="20"
										id="password" placeholder="请输入复杂些的密码" type="password"
										name="password" required>
								</div>
								<div class="col-md-3 " id="passwordInfo"></div>
							</div>
						</div>
						


						
						<div class="form-group" style="margin: 0 0 20px 100px">
							<label class="control-label col-md-2"> <strong>确认密码</strong>
							</label>
							<div id="password_okState">
								<div class="col-md-7">
									<input class="form-control" value="" maxLength="20"
										id="password_ok" placeholder="请再输入一次密码" type="password"
										name="password_ok" required>
								</div>
								<div class="col-md-3 " id="password_okInfo"></div>
							</div>
						</div>
						
						<div class="form-group" style="margin: 0 0 20px 100px">
							<label class="control-label col-md-2" for="email"> <strong>电子邮件</strong>
							</label>
							<div class="col-md-7">
								<input class="form-control" value="" placeholder="请输入常用的邮箱"
									maxLength="30" type="email" name="email" required>
							</div>
							<div class="col-md-3 " id="emailInfo"></div>
						</div>
						
						<div class="form-group" style="margin: 0 0 20px 100px">
							<label class="control-label col-md-2"> <strong>学号/工号</strong>
							</label>
							<div id="stunumState">
								<div class="col-md-7">
									<input class="form-control" value="" placeholder="请输入你的学号或工号"
										maxLength="15" id="stunum" name="stunum" type="text" required>
								</div>
								<div class="col-md-3 " id="stunumInfo"></div>
							</div>
						</div>
						
						<div class="form-group" style="margin: 0 0 20px 100px">
							<label class="control-label col-md-2"> <strong>身份确认</strong></label>
							
								<div class="col-md-7">
					
							<select id="adviser" name="identify" class="form-control" required>
								<option value="0"> 请选择</option>
								<option value="1"> 学生</option>
								<option value="2"> 教师</option>
								
							</select>
						</div>
					</div>
									
								

							
												
						<div class="form-group" style="margin: 0 0 20px 100px">
							<label class="control-label col-md-2"> <strong>手机号</strong>
							</label>
							<div>
								<div class="col-md-7">
									<input class="form-control" value=""
										placeholder="请填写真实手机号，方便联系您" maxLength="11" id="phone"
										name="phone" type="text" required>
								</div>
								<div class="col-md-3 " id="phoneInfo"></div>
							</div>
						</div>
						
						<div class="form-group" style="margin: 0 0 20px 100px">
							<label class="control-label col-md-2"> <strong>真实姓名
							</strong>
							</label>
							<div id="nameState">
								<div class="col-md-7">
									<input class="form-control" value="" maxLength="5" id="name"
										placeholder="请输入真实姓名" type="text" name="realname" required>
								</div>
								<div class="col-md-3 " id="nameInfo"></div>
							</div>
						</div>
						
						<div class="form-group" style="margin: 0 0 20px 100px">
							<label class="control-label col-md-2"> <strong>个人介绍
							</strong>
							</label>
							<div id="nameState">
								<div class="col-md-7">
									<input class="form-control" value="这家伙很懒，什么都没留下" maxLength="40"
										id="intro" placeholder="这家伙很懒，什么都没留下" type="text" name="intro">
								</div>
								<div class="col-md-3 " id="introInfo"></div>
							</div>
						</div>
						
						<div class="form-group" style="margin: 0 0 20px 100px">
							<label class="control-label col-md-2"
								style="margin: 0 14px 0 -14px;"> <strong>头&nbsp;像</strong>
							</label>
							<div class="col-md-4">
								<div class="fileupload fileupload-new"
									data-provides="fileupload">
									<input type="hidden">
									<div class="fileupload-new img-thumbnail"
										style="width: 150px; height: 150x;">
										<img src="{$Think.const.RESOURCES}HOME/images/photo.png">
									</div>
									<div class="fileupload-preview fileupload-exists img-thumbnail"
										style="width: 150px; max-height: 150px;"></div>
									<div>
										<span class="btn btn-default btn-file"><span
											class="fileupload-new">选择头像</span><span
											class="fileupload-exists">重新选择</span><input type="file"
											name="photo"></span><a
											class="btn btn-default fileupload-exists"
											data-dismiss="fileupload" href="#">清除头像</a>
									</div>
								</div>
							</div>
						</div>
						
						<!--  <div class="form-group" style="margin: 0 0 20px 100px">
                            <label class="control-label col-md-2">
                                <strong>验证码</strong>
                            </label>
                            <p class="top15 captcha" id="captcha-container">
                                <input name="verify" width="50%" height="50px" class="captcha-text" placeholder="验证码" type="text">
                                <br/>
                                <img id="verifyImg" width="13%" class="left15" height="50" alt="验证码" src="{$Think.const.DOMAIN_NAME}Home/Account/Verify" title="点击刷新" style="margin: 10px 0 10px" onClick="changeVerify()">
                            </p>
                        </div>-->
                        
						<div class="form-group" style="margin: 0 0 20px 100px">
							<label class="control-label col-md-2"> </label>
							<div class="col-md-7">
								<button class="btn btn-primary" type="submit"
									style="width: 100%;">
									<strong>注&nbsp;册</strong>
								</button>
							</div>
						</div>
						
						<p class="signup" style="margin: 10px 0 10px 44%;">
							已经注册账号？ <a href="Login.html">现在登录</a>
						</p>
					</form>
				</div>
			</div>
		</div>
	</div>
	<include file="Public/HOME/HTML/footer.html" />
	</body>
	</html>